<template>
  <div class="view">
    <div class="item" v-for="item in menus" @click="toPage(item)">
      <div class="left">
        <image class="icon" :src="item.icon" />
        <div class="text">{{item.text}}</div>
      </div>
      <u-icon name="arrow-right" size="18"></u-icon>
    </div>
  </div>
</template>

<script setup>
import { navigate } from "@/util/navigate";

// 获取static/home/menus/下的静态图片
const modules = import.meta.glob("../../static/activity/menus/*", { eager: true });

function getAssetsImages(name) {
  return modules[`../../static/activity/menus/${name}`].default;
}
const menus = [{
  icon: getAssetsImages('1.png'),
  text: '活动列表'
 },
// {
//   icon: getAssetsImages('2.png'),
//   text: '活动类型'
// }, {
//   icon: getAssetsImages('3.png'),
//   text: '活动标签'
// }
]

function toPage(item){
  navigate({url: '/pages/activity/activityList/index'})
}
</script>

<style lang="scss" scoped>
page {
  background: #f3f3f3;
}
.view {
  display: flex;
  flex-direction: column;
  gap: 30rpx;
  padding: 30rpx;
  .item {
    padding: 28rpx 30rpx 28rpx 30rpx;
    background: #ffffff;
    border-radius: 16rpx;
    display: flex;
    justify-content: space-between;
    .left {
      display: flex;
      align-items: center;
      gap: 14rpx;
      .icon {
        width: 48rpx;
        height: 48rpx;
      }
      .text {
        font-size: 30rpx;
        font-family: PingFang SC, PingFang SC-Medium;
        font-weight: 500;
        text-align: left;
      }
    }
  }
}
</style>